//构造函数 Animal
function Animal(color,name,age){
    this.color=color
    this.name=name
    this.age=age
   
}

//构造函数 Poultry
function Poultry(color,name,age,leg){
    this.leg=leg
    Animal.apply(this,[color,name,age])
    this.info=function(){
       return `我是一个${this.color}的${this.name}，我已经${this.age}岁了，我有${this.leg}条腿`
    }
}
//创建对象
let p=new Poultry("灰色","小狗狗",1,4)
let p1=new Poultry("白色","茶杯猫",2,4)
let p2=new Poultry("红色","母鸡",1,2)
txt.innerHTML=p.info()
txt1.innerHTML=p1.info()
txt2.innerHTML=p2.info()
